﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProductSystem.BLL.Common
{
    public static class DecimalExtension
    {
        private static string nullValueString = "——";
        public static string ToStringOrDefault(this decimal? source, string defaultString)
        {
            return source.HasValue ? source.Value.ToString() : defaultString;
        }

        public static string ToStringOrDefault(this decimal? source)
        {
            return source.ToStringOrDefault(nullValueString);
        }
    }
}
